##
## Makefile for nibbler in /home/lefebv_w//workspace/cpp/nibbler/v2
## 
## Made by damien lefebvre
## Login   <lefebv_w@epitech.net>
## 
## Started on  Fri Mar  8 12:24:52 2013 damien lefebvre
## Last update Fri Jul 26 17:40:42 2013 mickael gomes
##

NAME			=	nibbler

SFML			=	lib_nibbler_sfml.so
NCURSES			=	lib_nibbler_ncurses.so
CACA			=	lib_nibbler_caca.so

CC			=	g++
RM			=	rm -f

CFLAGS			=	-Wall -Wextra -Werror -g
LFLAGS			=	-ldl

FPIC			=	-fPIC

SFML_FLAGS		=	-lsfml-graphics -lsfml-window -lsfml-system
NCURSES_FLAGS		=	-lncurses
CACA_FLAGS		=	-lcaca

SRCS			=	main.cpp		\
				Case.cpp		\
				Game.cpp		\
				Snake.cpp		\
				BonusPart.cpp		\
				Bonus5Part.cpp		\
				Score.cpp		\
				BonusManager.cpp	\
				BonusLife.cpp

OBJS			=	$(SRCS:.cpp=.o)

SRCS_SFML		=	LibGraphic_sfml.cpp

SRCS_NCURSES		=	LibGraphic_ncurse.cpp

SRCS_CACA		=	LibGraphic_caca.cpp

all			:	$(NAME) $(SFML) $(NCURSES) $(CACA)

$(NAME)			:	$(OBJS)
				$(CC) -o $(NAME) $(CFLAGS) $(LFLAGS) $(OBJS)

$(SFML)			:	
				$(CC) $(FPIC) $(SFML_FLAGS) -o $(SFML) -shared $(SRCS_SFML)

$(NCURSES)		:	
				$(CC) $(FPIC) $(NCURSES_FLAGS) -o $(NCURSES) -shared $(SRCS_NCURSES)

$(CACA)			:	
				$(CC) $(FPIC) $(CACA_FLAGS) -o $(CACA) -shared $(SRCS_CACA)

clean			:
				$(RM) $(OBJS)

fclean			:	clean
				$(RM) $(NAME)
				$(RM) $(SFML)
				$(RM) $(NCURSES)
				$(RM) $(CACA)

re			:	fclean all